#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
 
int main (){
    int file ;
    file = open ("myfile.txt",O_RDWR | O_CREAT,0755);
    if(file< 0){
       printf("error creating/opening file!\n");}
       char * writethis = "I am writing to the file ." ;

        int writesz;
        writesz = write (file, writethis ,strlen(writethis));
             if(writesz< 0){
       printf("error writing to file!\n");}

       if (close(file)<0){
           printf("error!\n");}
         
        




    return 0 ;
}